package com.rogo.rogobox.views
{
	import com.rogo.mvc.sub.mediator.Mediator;
	import com.rogo.rogobox.views.components.GroupContent;
	
	import flash.events.MouseEvent;
	
	import mx.core.FlexGlobals;
	import mx.core.UIComponent;
	
	public class GroupContentMediator extends Mediator
	{
		public function GroupContentMediator(viewComponent:UIComponent)
		{
			super(NAME, viewComponent);
		}
		
		//--------------------------------------------------------------------------
		//
		//  Constants
		//
		//--------------------------------------------------------------------------
		
		public static const NAME:String = 'groupContentMediator';
		
		//--------------------------------------------------------------------------
		//
		//  Methods
		//
		//--------------------------------------------------------------------------
		
		public function get view():GroupContent
		{
			return viewComponent as GroupContent;
		}
		
		private function topContent_mouseDownHandler(e:MouseEvent):void
		{
			FlexGlobals.topLevelApplication.nativeWindow.startMove();
		}
		
		//--------------------------------------------------------------------------
		//
		//  Overridden Methods
		//
		//--------------------------------------------------------------------------
		
		override public function onRegister():void
		{
			view.topContent.addEventListener(MouseEvent.MOUSE_DOWN, topContent_mouseDownHandler);
		}
		
	}
}